package org.zjt.auth.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import org.zjt.auth.MQ.activemq.ActiveMQMsgSender;
import org.zjt.auth.MQ.rabbitmq.RabbitMQMsgSender;

@RestController
public class MQController {
	
	@Autowired
	private ActiveMQMsgSender activeMsgSender;
	@Autowired
	private RabbitMQMsgSender rabbitMsgSender;

	
	@RequestMapping(value = "/activeMQ")
    public ModelAndView activeMQ() throws Exception {
        ModelAndView result = new ModelAndView("view");   //ModelAndView的构造函数放入jsp的名、路径（跳转jsp）
        activeMsgSender.sendMsg("activeMQ : 2016-11-13 15:57:00" );
        result.addObject("msg", "ok");
        return result;
    }
	
	@RequestMapping(value = "/rabbitMQ")
    public ModelAndView rabbitMQ() throws Exception {
        ModelAndView result = new ModelAndView("view");   //ModelAndView的构造函数放入jsp的名、路径（跳转jsp）
        rabbitMsgSender.sendMsg("rabbitMQ : 2016-11-13 15:57:00" );
        result.addObject("msg", "ok");
        return result;
    }
	
	
}
